package com.iu.eblood.Jms.Core;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;  
import org.springframework.jms.core.MessageCreator;  

import com.iu.eblood.Jms.Messages.SmsMessageJMS;

@Service("smsProducerImpl")
public class SmsProducerImpl {
	
	//@Autowired
	//private JmsTemplate jmsTemplate;

	public void sendMessages() throws JMSException
	{
		
	  System.out.println("PRODUCER");
	  
	  MessageCreator messageCreator = new MessageCreator()
	  {
	   public Message createMessage(Session session) throws JMSException
	   {
		SmsMessageJMS s=new SmsMessageJMS();
		s.setTitle("sms1");
	    Message message = session.createObjectMessage(s);
	    return message;
	   }
	  };
	  //jmsTemplate.send("eblood.sms.queue",messageCreator);
	  
	 }
	

}
